#pragma once

#ifdef WIN32

#include "socket.h"

class SocketWin : public Socket
{
public:

	SocketWin(SocketType socketType);
	virtual ~SocketWin();

	virtual int GetLastError();

	virtual bool CreateSocket(int socketId = -1);
	virtual bool CloseSocket();
	virtual bool SetNonBlocking();
	virtual bool Bind(uint16 port, char* ip = NULL);
	virtual bool Listen(int backLop = -1);
	virtual bool Accept(int& socket, char* &ip, uint16& port);
	virtual bool Connect(char* ip, uint16 port);
	virtual bool Send(const char* buffer, int& size);
	virtual bool SendTo(const char* buffer, int& size, char* ip, uint16 port);
	virtual bool Recv(char* &buffer, int& size);
	virtual bool RecvFrom(char* &buffer, int& size, char* &ip, uint16& port);

	virtual bool Select(SocketSelectFlag selectFlag);
};

#endif //WIN32